<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
<!--
	function back(){
		var sign = "<c:out value='${sign}'/>";
		var contractId = "<c:out value='${id}'/>";//合同id
		window.location.href = "./contract.do?action=contractDetail&sign="+sign+"&id="+contractId;
		window.location.target = "main";
	}
	
-->
</script>
</head>
<body>
	<table class="table_frame" cellpadding="0" cellspacing="0">
		<tr>
			<td>
				<table class="table_title" cellpadding="0" cellspacing="0">
					<tr>
						<td class="title_lab" colspan="3">
							&nbsp;&nbsp;&nbsp;&nbsp;回款开票信息
						</td>
					</tr>
					<tr><td height="15"></td></tr>
					<tr>
						<td valign="bottom" align="right">
							<a href="javascript:back();">返回合同全貌</a>&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="5"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2" cellpadding="0" cellspacing="0">
					<tr>
						<td width="10" valign="bottom">&nbsp;</td>
						<td width="120">开票信息</td>
						<td width="200"></td>
						<td width="490"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_view" cellpadding="0" cellspacing="0">
					<tr>
						<td class="title" width="12%">开票金额(元)</td>
						<td class="title" width="12%">开票时间</td>
						<td class="title" width="12%">领票人</td>
						<td class="title">备注</td>
					</tr>
					<c:forEach var="invoice" items="${invoices}">
					<tr>
						<td>${invoice.invoiceCost}</td>
						<td><fmt:formatDate value="${invoice.invoiceDate}" pattern="yyyy-MM-dd"/></td>
						<td>${invoice.invoicePerson}</td>
						<td>${invoice.invoiceDesc}</td>
					</tr>
					</c:forEach>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20"></td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_title2" cellpadding="0" cellspacing="0">
					<tr>
						<td width="10" valign="bottom">&nbsp;</td>
						<td width="120">回款列表</td>
						<td width="200"></td>
						<td width="490"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_view" cellpadding="0" cellspacing="0">
					<tr>
						<td class="title" width="12%">金额(元)</td>
						<td class="title" width="12%">付款类型</td>
						<td class="title" width="12%">付款方式</td>
						<td class="title" width="12%">回款日期</td>
						<td class="title" width="12%">销售代表</td>
						<td class="title">备注</td>
					</tr>
					<c:forEach var="backCost" items="${backCosts}">
					<tr>
						<td>${backCost.cost}</td>
						<td>
						<c:forEach var="range" items="${ranges['32']}">
							<c:if test="${range.id == backCost.backCostTypeId}">${range.rangeValue}</c:if>
						</c:forEach>
						</td>
						<td>
						<c:forEach var="range" items="${ranges['33']}">
							<c:if test="${range.id == backCost.backCostWayId}">${range.rangeValue}</c:if>
						</c:forEach>
						</td>
						<td><fmt:formatDate value="${backCost.backDate}" pattern="yyyy-MM-dd"/></td>
						<td>${backCost.salePerson}</td>
						<td>${backCost.backCostDesc}</td>
					</tr>
					</c:forEach>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table class="table_page" height="30" cellpadding="0" cellspacing="0">
					<tr>
						<td class="title_status" width="10%">合同总额：</td>
						<td class="title_status" width="10%">${contract.contractCost}元</td>
						<td class="title_status"></td>
						<td class="title_status" width="10%">回款累计：</td>
						<td class="title_status" width="10%">${contract.backCost}元</td>
						<td class="title_status"></td>
						<td class="title_status" width="10%">回款次数：</td>
						<td class="title_status" width="10%">${contract.backCostNum}次</td>
						<td class="title_status"></td>
						<td class="title_status" width="10%">应收余额：</td>
						<td class="title_status" width="10%">${contract.receivable}元</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>